package com.cmas.platform.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cmas.platform.domain.Message;
import com.cmas.platform.vo.LastMessageVo;
import com.cmas.platform.vo.MessageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 消息表Mapper接口
 *
 * @author su
 * @email 1218819874@qq.com
 * @date 2023-04-28
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    /**
     * 批量删除消息表
     *
     * @param ids 需要删除的消息表ID集合
     * @return
     */
    public int deleteMessageByIds(@Param("ids") String[] ids, @Param("DEL_FLAG_DELETE") String DEL_FLAG_DELETE);

    public List<Message> selectUserMessage(@Param("userId") String userId);

    public List<MessageVo> selectMessageList(@Param(Constants.WRAPPER) QueryWrapper<Message> setQueryWrapper);

    public List<LastMessageVo> selectLastMessage(@Param("current") int current, @Param("size") int size,
                                                 @Param("userId") String userId);

}
